<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/stylewang.css"  type=text/css rel=stylesheet>
		<style type="text/css">
		.divcontent   {   overflow-y:   scroll;   height:   100%;   width:   100%;}
		</style>
		<title>CGProject</title>
		<html:base/>
		<script language=javascript>
			function Add(){
				var addrow=document.getElementById("AddNote");
				addrow.innerHTML="<form action='addnote.do?taskId=<bean:write name="task" property="taskId"/>' method='POST'><textarea name='note' size='100%' length='200' type='text'></textarea> <input type='submit'  value='Submit'><a href='javascript:back()' >Cancel</a>";
			}
			function Isdoing(id){
    			parent.location.href="isdong.do?taskId="+id;
			}
			function CommitConfirm(id){
    			parent.location.href="commitConfirm.do?taskId="+id;
			}
			function Finish(id)
			{
				parent.location.href="finish.do?taskId="+id;
			}
			function back(){
				var cell = document.getElementById("AddNote");
				cell.innerHTML = " <input type='button' Value='AddNote' onclick='Add()'/> ";
			}
			
			function showTaskInfo(url){
				top.B.location.href = url;
			}
			function upload1(){
				window.open('<%=path %>/myJob/send.jsp?receiver=<%=request.getAttribute("confirmNames")%>&copyer=<%=request.getAttribute("projectManagerName")%>&taskName=<bean:write name="task" property="taskName"/>','send','top=150,left=150,scrollbars=yes,dialog=yes,modal=yes,width=570,height=445,resizable=no');
			}
			function upload2(){
				var forms=document.getElementsByTagName("form");
				forms[0].submit();
			}
			</script>
	</head>

	<body onLoad="showTaskInfo('../frame.do?Frame=12&Id=16&Type=<bean:write name="Type"/>
<html:html> 
	&ObjectID=<bean:write name="ID"/>');">
		
		<table  border="0" width="100%" cellspacing="0" id="table1">
		 <tr>
			<td width="56%"  valign="top">
<div>		
	 <table  border="0" width="100%" cellspacing="0" id="table1" >
			
				<tr>
					<td width="30%" id="btleftbian">
					<bean:message key="task"/>
					<logic:notEmpty name="canStart">
						<logic:notEqual name="task" property="status.statusName" value="IsDoing">
							<input type='button' Value="Isdoing" onClick="Isdoing(<bean:write name="task" property="taskId"/>)"/>		
						</logic:notEqual>
					</logic:notEmpty>
					
					</td>
					<td  width="23%" id="btcenterbian">
					<b><bean:message key="planstarttime"/></b></td>
					<td width="14%" id="btcenterbian">
					<b><bean:message key="expectedhours"/></b></td>
					<td width="16%" id="btrightbian">
					<b><bean:message key="task.status"/></b></td>
					
				</tr>
			
		<tr>
			<td width="30%" id="leftcenter">
				<bean:write name="task" property="taskName"/>&nbsp;</td>
			<td  width="16%" id="leftcenter">
				<bean:write name="task" property="ve"/>&nbsp;</td>
			<td  width="14%" id="leftcenter">
				<bean:write name="task" property="exceptHours"/>&nbsp;</td>
			<td  width="16%" id="rightcenter">
					
				<script language=javascript>
					var s=top.changeColor("<bean:write name="task" property="status.statusDisplay"/>");
					document.write(s);
				</script>&nbsp;
			</td>		
		</tr>
		<logic:empty name="canStart">
		
		<tr>
		<td  colspan="4"  width="23%" id="onlybt">
			<b>&nbsp;<font color="red"><bean:message key="waitpreviousmake"/></font></b></td>
		</tr>
		<logic:iterate id="element" name="UnFinishedMakes">
		<tr>
			<td  colspan="1" width="11%" id="rightbottom">
			&nbsp;<bean:write name="element" property="makeName"/>
			</td>
			<td  colspan="3" width="12%" id="rightbottom">
			<script language=javascript>
					var s=top.changeColor("<bean:write name="element" property="status.statusDisplay"/>");
					document.write(s);
				</script>&nbsp;
			</td>
		</tr>
		</logic:iterate>
		</logic:empty>
		
		<tr>
			<td  colspan="4"  width="23%" id="onlybt">
			<b>&nbsp;<bean:message key="description"/></b></td>
		</tr>
		<tr>
			<td  colspan="4" width="23%" id="rightbottom">
			&nbsp;<bean:write name="task" property="taskDescription"/></td>
		</tr>
	</table>
	
<logic:notEmpty name="canStart">
			 
	<logic:equal name="task" property="status.statusName" value="IsDoing">
		<form action="<bean:write name="servletPath"/>"  method="post" enctype="multipart/form-data">
			 	<input type="hidden" name="taskId" value="<bean:write name="task" property="taskId"/>">
			 <table  border="0" width="100%" cellspacing="0" id="table1">
			 	<tr>
			 		<td id="onlybt" width="100%">
			 			<b><bean:message key="ForCheck"/></b>
			 		</td>
			 	</tr>
			 	<tr>
					<td id="rightcenter">
					<a><bean:message key="MediaFile"/></a>
					<input type="file" name="MediaFile" size="20">
					</td>
					<td>
					</td>
				</tr>
				<tr>
					<td id="rightbottom">
					<a> <bean:message key="MakeFile"/></a>&nbsp; 
					<input type="file" name="MakeFile" size="20">
					</td>
					<td>
					<input type="button" name="command" value="Upload" onClick="upload1();">
					</td>
				</tr>
			 </table>
		</form>
	</logic:equal>
	<logic:equal name="task" property="status.statusName" value="ConfirmPassed">
		<form action="<bean:write name="servletPath"/>"  method="post" enctype="multipart/form-data">
			 	<input type="hidden" name="taskId" value="<bean:write name="task" property="taskId"/>">
			  <table  border="0" width="100%" cellspacing="0" id="table1">
			 	<tr>
			 		<td id="onlybt">
			 			<b><bean:message key="UploadFinishFile"/></b>
			 		</td>
			 	</tr>
			 	<tr>
					<td id="rightcenter">
					<a><bean:message key="MediaFile"/></a>
					<input type="file" name="FinishedMediaFile" size="20">
					</td>
					<td>
					</td>
				</tr>
				<tr>
					<td id="rightbottom">
					<a> <bean:message key="MakeFile"/></a>&nbsp; 
					<input type="file" name="FinishedMakeFile" size="20">
					</td>
					<td>
					<input type="button" name="command" value="Upload" onClick="upload2();">
					</td>
				</tr>
			 </table>
		</form>
	</logic:equal>
</logic:notEmpty> <!-- logic:notEmpty name="canStart"  -->
	
	</div>
			</td>
			<td   align="left" valign="top">
	<div class="divcontent">
	 <table border="0" width="100%" cellspacing="0" id="table1" >

			  <tr>
			  	<td width="20%" id="btleftbian">
					&nbsp;<b><bean:message key="name"/></b></td>
				<td  width="22%" id="btcenterbian">
					<b><bean:message key="time"/></b></td>
					
				<td  width="28%" id="btcenterbian">
					<b><bean:message key="information"/></b></td>
				<td  width="16%" id="btrightbian">
					<b><bean:message key="IsPassed"/></b></td>
			  </tr>
			 <logic:iterate id="element" name="ConfirmHistory">
			  <tr>
			   <td  width="20%"  id="leftcenter">
				&nbsp;<bean:write name="element" property="reguser.regName"/>
			   </td>
			   <td  width="22%"  id="leftcenter">
				&nbsp;<bean:write name="element" property="confirmTime" format="yyyy-MM-dd HH:mm"/>
			   </td>
			   <td  width="=30%"  id="leftcenter">
				&nbsp;<bean:write name="element" property="confirmInformation"/>
			   </td>
			   <td  width="16%"  id="rightcenter">
			     &nbsp;<logic:equal name="element" property="isPass" value="1"><font color='green'>Pass</font></logic:equal>
			     <logic:equal name="element" property="isPass" value="0"><font color='red'>NotPass</font></logic:equal>
			   </td>
			  </tr>
			 </logic:iterate>
			 <tr><td colspan="4">
         <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tdtop">
            <tr>
              <td></td>
             </tr>
         </table></td>
        </tr>
		 <tr>
			  <td  colspan="4" id ="AddNote"  maxLength="500" cellspacing="5" align="left" width="20%" ><input type='button' Value="AddNote" onClick="Add()"/></td>
			 </tr>
			</table>
		</div>
		  </td>
		 </tr>
		</table>
		</body>
</html:html>